using System;
using System.Collections.Generic;
using System.Text;

using Peradigm.Framework.Persistence;
using Peradigm.Framework.Domain.Security;
using Liberty.Tests.DomainTests;

using Liberty.Domain.CaseManagement;
using Liberty.Domain.GrantManagement;
using Microsoft.VisualStudio.TestTools.UnitTesting;

//using NUnit.Framework.SyntaxHelpers;

namespace Tests.DomainTests.GrantManagement
{

#if DEBUG
    [TestClass()]
    public class GrantTests : Object
    {
        #region Constants
        private DateTime? DISPERSAL_DATE = null;
        #endregion

        #region SetUp and TearDown GrantTests
        [TestInitialize()]
        public void SetUpGrantTests()
        {
        }

        [TestCleanup()]
        public void TearDownGrantTests()
        {
        }
        #endregion

        #region Test Methods
        [TestMethod()]
        public void TestProperties()
        {
            Grant aGrant = new Grant();
            aGrant.DeliveryMethod = DeliveryMethod.TestInstance();
            aGrant.PaymentType = PaymentType.TestInstance();
            
            Assert.AreEqual( DeliveryMethod.TestInstance(), aGrant.DeliveryMethod );
            Assert.AreEqual( PaymentType.TestInstance(), aGrant.PaymentType );
            Assert.AreEqual( GrantState.TestInstance(), aGrant.Status );
        }

        [TestMethod()]
        public void TestApprovals()
        {
            Grant testGrant = Grant.TestInstance();
            Assert.AreEqual( 0, testGrant.Events.Count() );
            User 
                worker1 = new User( PersistentModel.NEW_OID, "John", "Doe" ),
                worker2 = new User( PersistentModel.NEW_OID, "Jane", "Doe" );
            testGrant.ApproveBy( worker1 );
            Assert.AreEqual( 1, testGrant.Events.Count() );
            testGrant.ApproveBy( worker2 );
            Assert.AreEqual( 2, testGrant.Events.Count() );
        }

        [TestMethod()]
        public void TestDispersals()
        {
            Grant testGrant = Grant.TestInstance();
            Assert.AreEqual( 0, testGrant.Events.Count() );
            User worker1 = new User( PersistentModel.NEW_OID, "John", "Doe" );
            testGrant.ApproveBy( worker1 );
            Assert.AreEqual( 1, testGrant.Events.Count() );
        }

        [TestMethod()]
        public void TestVerifications()
        {
            Grant testGrant = Grant.TestInstance();
            Assert.AreEqual( 0, testGrant.Events.Count() );
            User worker1 = new User( PersistentModel.NEW_OID, "Jane", "Doe" );
            testGrant.ApproveBy( worker1 );
            Assert.AreEqual( 1, testGrant.Events.Count() );
        }
        #endregion

        #region Support Methods
        #endregion

        #region Data Elements
        #endregion

    }
#endif

}
